<?php
/**
 * connection settings
 * replace with your own hostname, database, username and password
 */
$hst = "127.0.0.1";
$prt = "3306";
$srv = $hst.":".$prt;
$db = "moonland_beeline";
$usr = "root";
$pwd = "titmouse";

global $conn;

$conn = mysql_pconnect($srv, $usr, $pwd) or die(mysql_error());
mysql_select_db($db, $conn);
mysql_query("SET NAMES 'utf8'");

/* Test connection */

if ( $_REQUEST['mode'] == 'test' ) 
{
	$sql = "select 	* from hives;";
	$rs = mysql_query($sql);

	if (!$rs)
	{
		print "<font color='red'>ERROR:</font> " . mysql_error() . "<br/>";
		print "<font color='blue'>SQL:</font> \"" . $sql . "\"<br/>";
		die();
	}

	while ($cols = mysql_fetch_assoc($rs))
	{
		foreach ($cols as $col)
		{
			print "$col&nbsp;";	
		}
		print "<br/>\n";
	}
	mysql_free_result($rs);
}
?>
